{% extends "./layout.html"%} {%block main%}
<style>
	.box {
		margin: 10px;
		padding: 30px;
		border: 1px solid #ddd;
		box-shadow: 2px 2px 2px rgba(0, 0, 0, .2);
		padding-top: 15px
	}
	
	.col {
		margin-bottom: 15px;
		padding-left: 0;
	}
	
	h6 {
		margin-bottom: 10px;
	}
</style>
<div class="layui-row">
	<div class="layui-col-md4">
		<div class="box" style='text-align: center;'>
			<div id='qrcode' style='margin-top:25px'>

			</div>

			<div style="font-size: 18px;color: #f60;line-height: 26px;margin-top:25px">
				{{proxy.name}}
			</div>

			<div id='qrcodeurl' width='60%;' style='word-wrap: break-word;margin-top:15px'>
				https://comingcard.com/s/5981ac8ff3f31909021826
			</div>

			<div style='line-height: 26px;margin-top:15px;font-size: 16px;'>
				{%if proxy.type == 'normal'%} 综合会员 {%elif proxy.type == 'jingji'%} 经纪会员 {%elif proxy.type == 'jigou'%} 机构代理 {%elif proxy.type == 'jujian'%} 居间代理 {%endif%}
			</div>

			<hr />

		</div>
	</div>
	<div class="layui-col-md4">
		<div class="box">
			<h2 style="font-size: 24px;margin-bottom: 10px;">
				登录密码
			</h2>
			<hr />
			<form action="" class="layui-form">
				<div class="col">
					<h6>旧密码</h6>
					<input type="password" class="layui-input" name="oldpass" placeholder="旧密码" />
				</div>

				<div class="col">
					<h6>登录密码</h6>
					<input type="password" class="layui-input" name="pass" placeholder="登录密码" />
				</div>
				<div class="col">
					<h6>确认登录密码</h6>
					<input type="password" class="layui-input" name='confirm' placeholder="确认登录密码" />
				</div>

				<div style=''>
					<a href="javascript;" lay-submit lay-filter='modify_login' class="layui-btn layui-btn">确认修改</a>
				</div>
			</form>
		</div>
	</div>
	<div class="layui-col-md4">
		<div class="box">
			<h2 style="font-size: 24px;margin-bottom: 10px;">
				支付密码
			</h2>
			<hr />
			<form action="" class="layui-form">
				<div class="col">
					<h6>旧密码(默认为000000)</h6>
					<input type="password" class="layui-input" name="oldpass" placeholder="旧密码" value='{{"000000" if proxy.pay_password == "000000"}}' />
				</div>

				<div class="col">
					<h6>支付密码</h6>
					<input type="password" class="layui-input" name="pass" placeholder="支付密码" />
				</div>
				<div class="col">
					<h6>确认支付密码</h6>
					<input type="password" class="layui-input" name='confirm' placeholder="确认支付密码" />
				</div>

				<div style='padding-left: 10px;'>
					<a href="javascript;" lay-submit lay-filter='modify_pay' class="layui-btn layui-btn">确认修改</a>
				</div>
			</form>
		</div>
	</div>
</div>
{%endblock%} {%block js%}
<script src='/static/js/qrcode.js'></script>
<script src='/static/js/util.js'></script>

<script type="text/javascript">
	var url = 'http://' + location.host + '/proxy/invite/' + base64_encode('{{proxy.id}}');
	//var url = "在集成微信之前扫码无效";
	$('#qrcode').html("").qrcode({
		width: 200,
		height: 200,
		text: url
	});

	$('#qrcodeurl').html(url);
	
	
	layui.use(['form'],function(form){
		form.on("submit(modify_login)",function(data){
			$.post("/proxy/api/modify_self_login",data.field,function(json){
				if(json.success){
					layer.msg("保存成功",{icon : 1},function(){


					})
				}
				else{
					layer.msg(json.msg);
				}
			},'json');

			return false;
		})
		
		form.on("submit(modify_pay)",function(data){
			$.post("/proxy/api/modify_self_pay",data.field,function(json){
				if(json.success){
					layer.msg("保存成功",{icon : 1},function(){


					})
				}
				else{
					layer.msg(json.msg);
				}
			},'json');

			return false;
		})
	});
</script>
{%endblock%}